Skip to content

Overload: Limit the number of streams reset per invocation of WatermarkBufferFactory::resetAccountsGivenPressure.#17949

Merged
alyssawilk merged 2 commits intoenvoyproxy:mainfrom
KBaichoo:rst-stream-limit
Sep 7, 2021
Merged

Overload: Limit the number of streams reset per invocation of WatermarkBufferFactory::resetAccountsGivenPressure.#17949
alyssawilk merged 2 commits intoenvoyproxy:mainfrom
KBaichoo:rst-stream-limit

Conversation

@KBaichoo
Copy link
Copy Markdown
Contributor

@KBaichoo KBaichoo commented Sep 1, 2021

Signed-off-by: Kevin Baichoo kbaichoo@google.com

Commit Message: Limit the number of streams reset per invocation of WatermarkBufferFactory::resetAccountsGivenPressure.
Additional Description: Since we limit number of streams reset, we should start resetting the largest eligible streams first.
Risk Level: low
Testing: unit test
Docs Changes: Included
Release Notes: TBD
Platform Specific Features: NA
Related Issue #15791

WatermarkBufferFactory::resetAccountsGivenPressure.

Signed-off-by: Kevin Baichoo <kbaichoo@google.com>
@KBaichoo
Copy link
Copy Markdown
Contributor Author

KBaichoo commented Sep 1, 2021

/assign @alyssawilk

Copy link
Copy Markdown
Contributor

@alyssawilk alyssawilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Looks good modulo 2 tiny nits.
/wait

// Effectively disables tracking as this should zero out all reasonable account
// balances when shifted by this amount.
constexpr uint32_t kEffectivelyDisableTrackingBitshift = 63;
constexpr uint32_t kMaxNumberOfStreamsToResetPerInvocation = 50;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd comment here as well that 50 is arbitrary, to limit work done (as you doc up above)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

no streams will be reset. When heap usage is at or above 85%, we start to
reset buckets according to the strategy described below. When the heap
usage is at 95% all streams using >= 1MiB memory are eligible for reset.
This Overload action will reset up to 50 streams (this is a hardcoded limit)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Overload/overload?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Signed-off-by: Kevin Baichoo <kbaichoo@google.com>
Copy link
Copy Markdown
Contributor Author

@KBaichoo KBaichoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review @alyssawilk

// Effectively disables tracking as this should zero out all reasonable account
// balances when shifted by this amount.
constexpr uint32_t kEffectivelyDisableTrackingBitshift = 63;
constexpr uint32_t kMaxNumberOfStreamsToResetPerInvocation = 50;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

no streams will be reset. When heap usage is at or above 85%, we start to
reset buckets according to the strategy described below. When the heap
usage is at 95% all streams using >= 1MiB memory are eligible for reset.
This Overload action will reset up to 50 streams (this is a hardcoded limit)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@alyssawilk alyssawilk merged commit de5bf9b into envoyproxy:main Sep 7, 2021
tyxia pushed a commit to tyxia/envoy that referenced this pull request Sep 21, 2021
…rkBufferFactory::resetAccountsGivenPressure. (envoyproxy#17949)

Commit Message: Limit the number of streams reset per invocation of WatermarkBufferFactory::resetAccountsGivenPressure.
Additional Description: Since we limit number of streams reset, we should start resetting the largest eligible streams first.
Risk Level: low
Testing: unit test
Docs Changes: Included
Release Notes: TBD
Platform Specific Features: NA
Related Issue envoyproxy#15791
Signed-off-by: Kevin Baichoo <kbaichoo@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants